<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_主轴对齐方式</title>
    <style>
        .item{
            background-color: lightgreen;
            border: 3px solid green;
            width: 100px;
            height: 100px;
        }
        .box{
            /*给父容器使用弹性布局，所有子元素横置 且父元素 会根据 子元素的实际高度 自动填充高度*/
            background-color: yellow;
            display: flex;
            /*03 -主轴对齐方式 */
            justify-content: flex-start;/*主轴起点对齐*/
            justify-content: flex-end;/*主轴终点对齐*/
            justify-content: center;/*主轴居中对齐*/
            justify-content: space-between;/*主轴两端对齐*/
            justify-content: space-around;/*主轴环绕对齐*/
            justify-content: space-evenly;/*主轴公平对齐*/
            height: 350px;
            /*04 */
            align-items: flex-start;
            align-items: flex-end;
            align-items: center;

        }
        .box2{
            /*给父容器使用弹性布局，所有子元素横置 且父元素 会根据 子元素的实际高度 自动填充高度*/
            background-color: gray;
            height: 600px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            justify-content: flex-end;
            justify-content: center;
            justify-content: space-between;
            justify-content: space-around;
            justify-content: space-evenly;
            width: 500px;
            align-items: flex-start;
            align-items: flex-end;
            align-items: center;

        }

    </style>
</head>
<body>
<div class="box">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
</div>
<div class="box2">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
</div>
</body>
</html>